<%@ page language="java" import="java.util.*"  pageEncoding="UTF-8"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'DateJstl.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
  		<!--日期格式化  -->
  		<c:set var="now" value="<%=new java.util.Date() %>"/>
  		<c:out value="${now} "></c:out><br>
  		<fmt:formatDate value="${now }" type="both" /><br>
  		<fmt:formatDate value="${now }" type="both"  dateStyle="long" /><br>
  		<fmt:formatDate  value="${now}" pattern="yyyy/MM/dd" />
  		<c:set var="balance" value="12345.6789" />
		<h3>数字格式化:</h3>
		<c:set var="balance" value="12345.6789" />
		<p>格式化数字 (1): <fmt:formatNumber value="${balance}" 
            type="currency"/></p>
           <c:set var="balance2" value="0.3"></c:set>
  		<fmt:formatNumber type="percent" value="${balance2 }"></fmt:formatNumber>
		
  </body>
</html>
